/*
 * @Descripttion: 
 * @version: @ 1.0.0
 * @Author: ZJZ
 * @Date: 2021-06-24 17:36:58
 * @LastEditors: 朱江洲
 * @LastEditTime: 2022-06-02 09:46:29
 */
import request from "@/utils/request.js";
// 获取人员信息列表
export const getPerson = params => {
    return request({
        method: 'get',
        url: '/serviceProvide/person/list',
        params
    })
}
// 新增人员信息
export const addPerson = (data) => {
    return request({
        method: 'post',
        url: '/serviceProvide/person/add',
        data,
    })
}
// 获取人员信息详情
export const getPersonDetail = id => {
    return request({
        method: 'get',
        url: `/serviceProvide/person/${id}`,

    })
}

// 删除人员信息
export const delPerson = userId => {
    return request({
        method: 'delete',
        url: `/serviceProvide/person/` + userId,
    })
}

// 修改人员信息

export const putDetail = data => {
    return request({
        method: 'put',
        url: `/serviceProvide/person/edit`,
        data
    })
}

// 更改负责人

export const updatePrincipal = data => {
    return request({
        method: 'patch',
        url: `/serviceProvide/person/updatePrincipal`,
        data
    })
}

// 下载模版
export const importTemplate = () => {
    return request({
        method: 'get',
        url: `/serviceProvide/person/importTemplate`,
    })
}
// 导出
export const getExport = () => {
    return request({
        method: 'get',
        url: '/serviceProvide/person/export',

    })
}
// 导入
export const importExl = (data) => {
    return request({
        method: 'post',
        url: '/serviceProvide/person/importDate',
        data
    })
}
// 查询负责人
export const distriBution = () => {
    return request({
        method: "get",
        url: '/serviceProvide/distribution/getPersonLiable'
    })
}
// 更换负责人
export const bindingPersonLiable = params => {
    return request({
        method: 'get',
        url: '/serviceProvide/person/changeDirector',
        params
    })
}
// 获取在线报名信息
export const selectEnrollOnline = params => {
    return request({
        method: 'get',
        url: '/serviceProvide/examBatch/selectEnrollOnline',
        params
    })
}

// 人员列表查询接口
export const getexaminerList = params => {
    return request({
        method: 'get',
        url: '/serviceProvide/person/list',
        params
    })
}

// 获取自定义字段列表
export const getCustom = data => {
    return request({
        method: 'post',
        url: '/serviceProvide/examiner/enrollField',
        data
    })
}


// 自定义字段接口使用
export const registerInformation = data => {
    return request({
        method: 'post',
        url: '/serviceProvide/registerInformation/save',
        data
    })
}

// 报名信息展示
export const getExaInfo = params => {
    return request({
        method: 'get',
        url: '/serviceProvide/registerInformation/list',
        params
    })
}

// 支付宝支付接口
export const aliPay = data => {
    return request({
        method: 'post',
        url: '/serviceProvide/aliPay/pay',
        data
    })
}

// 支付宝轮询
export const aliQuery = data => {
    return request({
        method: 'post',
        url: '/serviceProvide/aliPay/aliQuery',
        data
    })
}

// 取消订单
export const aliCancel = data => {
    return request({
        method: 'post',
        url: '/serviceProvide/aliPay/aliCancel',
        data
    })
}

// 查询支付宝配置信息
export const aliSet = () => {
    return request({
        method: 'get',
        url: '/serviceProvide/aliPayConfig/getConfig',
    })
}

// 查询微信配置信息
export const chatSet = () => {
    return request({
        method: 'get',
        url: '/serviceProvide/wechatPayConfig/getConfig',
    })
}

// 微信支付接口
export const chatPay = data => {
    return request({
        method: 'post',
        url: '/serviceProvide/wechatPay/payUrl',
        data
    })
}
// 微信轮询查是否支付
export const chatQuery = data => {
    return request({
        method: 'post',
        url: '/serviceProvide/wechatPay/orderQuery',
        data
    })
}
// 取消订单
export const chatCancel = data => {
    return request({
        method: 'post',
        url: '/serviceProvide/wechatPay/closeOrder',
        data
    })
}
// 人员信息附件列表查询
export const fileList = fileId => {
    return request({
        method: 'get',
        url: `/serviceProvide/file/queryById/${fileId}`,
    })
}
// 报名信息自定义信息
export const getInfo = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/registerInformation/getCustomFieldData`,
        params
    })
}
// 预览
export const perPreview = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/person/preview`,
        params
    })
}


// 新增学员
export const addStudent = (data) => {
    return request({
        method: 'post',
        url: '/serviceProvide/person/addStudent',
        data,
    })
}
// 上传自定义文件
export const saveFile = (data) => {
    return request({
        method: 'post',
        url: '/serviceProvide/registerInformation/saveFile',
        data,
    })
}

// 企业信息
export const selectDeptInfoByOrgId = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/examBatch/selectDeptInfoByOrgId`,
        params
    })
}


// 获取打印数据
export const getPrint = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/registerInformation/print`,
        params
    })
}


// 上传图片变成url
export const getUrl = data => {
    return request({
        method: 'post',
        url: `/serviceProvide/person/getUrl`,
        data
    })
}

// 导出人员图片
export const downImg = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/registerArrange/download`,
        params
    })
}

// 导出选中
export const exportByIds = data => {
    return request({
        method: 'post',
        url: `/serviceProvide/registerInformation/exportByIds`,
        data
    })
}

// 导出全部
export const exportAll = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/registerInformation/exportAll`,
        params
    })
}

// - 企业报名优惠券列表
export const companyCoupon = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/coupon/companyCoupon`,
        params
    })
}

// 计算价格
export const calculate = data => {
    return request({
        method: 'post',
        url: `/serviceProvide/coupon/calculate`,
        data
    })
}
// - 个人报名优惠券列表
export const personCoupon = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/coupon/personCoupon`,
        params
    })
}

// 报名信息详情
export const updateList = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/examiner/updateList`,
        params
    })
}
// 报名信息详情修改
export const updateManagement = data => {
    return request({
        method: 'post',
        url: `serviceProvide/examiner/update`,
        data
    })
}